home *** CD-ROM | disk | FTP | other *** search
/ PC Advisor 2007 June / PC Advisor 2007 June.iso / FULL / OPENOFFICE / openoffice.exe / openofficeorg2.cab / layoutX.xsl < prev    next >
Extensible Markup Language  |  2006-11-30  |  8KB  |  300 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--*************************************************************************
  3.  *
  4.  *  OpenOffice.org - a multi-platform office productivity suite
  5.  *
  6.  *  $RCSfile: makefile,v $
  7.  *
  8.  *  $Revision: 1.1 $
  9.  *
  10.  *  last change: $Author: st $ $Date: 2000/11/22 02:32:00 $
  11.  *
  12.  *  The Contents of this file are made available subject to
  13.  *  the terms of GNU Lesser General Public License Version 2.1.
  14.  *
  15.  *
  16.  *    GNU Lesser General Public License Version 2.1
  17.  *    =============================================
  18.  *    Copyright 2005 by Sun Microsystems, Inc.
  19.  *    901 San Antonio Road, Palo Alto, CA 94303, USA
  20.  *
  21.  *    This library is free software; you can redistribute it and/or
  22.  *    modify it under the terms of the GNU Lesser General Public
  23.  *    License version 2.1, as published by the Free Software Foundation.
  24.  *
  25.  *    This library is distributed in the hope that it will be useful,
  26.  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
  27.  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  28.  *    Lesser General Public License for more details.
  29.  *
  30.  *    You should have received a copy of the GNU Lesser General Public
  31.  *    License along with this library; if not, write to the Free Software
  32.  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33.  *    MA  02111-1307  USA
  34.  *
  35.  ************************************************************************-->
  36.  
  37. <xsl:stylesheet version="1.0" 
  38.    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  39.     xmlns="http://www.w3.org/1999/xhtml">
  40.     
  41.     <xsl:output method               = "html"
  42.                 media-type           = "text/html"
  43.                 indent               = "yes"
  44.                 doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
  45.                 omit-xml-declaration = "yes"
  46.                 standalone           = "yes" />
  47.     
  48.     <xsl:include href="../layout.xsl"/>
  49.    
  50.  
  51.      <!-- =============================
  52.                    ROOT
  53.      ================================== -->
  54.  
  55.  
  56.     <xsl:template  match="/">
  57.           <html>
  58.                    <xsl:call-template name="head"/>
  59.                   <xsl:call-template name="body"/>
  60.            </html>
  61.      </xsl:template>
  62.      
  63.      
  64.      <!-- =============================
  65.                    HTML BODY
  66.      ================================== -->
  67.      
  68.      <xsl:template name="body">
  69.          <body>
  70.              <xsl:call-template name="title"/>
  71.              <xsl:call-template name="toc"/>
  72.         </body>
  73.      </xsl:template>
  74.      
  75.      
  76.      <xsl:template name="toc">
  77.         <!--
  78.              @ pre toc html here
  79.         -->
  80.         
  81.         <!-- use this to group documents, it
  82.         is for example usefull when generating tables -->
  83.         
  84.         <xsl:variable name="group" select="3"/>
  85.         
  86.         <xsl:for-each select="/session/content/document[ ( ( position() - 1 ) mod $group ) = 0 ]">
  87.             
  88.             <!-- 
  89.                 @ pre group html here 
  90.             -->
  91.             
  92.             <xsl:call-template name="document-group">
  93.               <xsl:with-param name="group" select="$group"/>
  94.             </xsl:call-template>  
  95.             
  96.             <!--
  97.                 @ post group html here
  98.             -->
  99.             
  100.         </xsl:for-each>
  101.  
  102.  
  103.         <!-- use this alternative if you do not need to use groups 
  104.         (uncomment to use - and do not forget to comment the group 
  105.         option above...)-->
  106.  
  107.         <!-- 
  108.       <xsl:apply-templates select="/session/content/document"/>
  109.         -->
  110.  
  111.         <!--
  112.              @ post toc html here
  113.         -->
  114.  
  115.      </xsl:template>
  116.      
  117.     <!-- also when using groups, in the end it comes 
  118.     to this template, which is called for each document -->
  119.     <xsl:template match="document">
  120.       <xsl:apply-templates select="@title"/>
  121.       <xsl:apply-templates select="@description"/>
  122.       <xsl:apply-templates select="@author"/>
  123.       <xsl:apply-templates select="@create-date"/>
  124.       <xsl:apply-templates select="@update-date"/>
  125.       <xsl:apply-templates select="@filename"/>
  126.       <xsl:apply-templates select="@format"/>
  127.       <xsl:apply-templates select="@format-icon"/>
  128.       <xsl:apply-templates select="@format-icon"/>
  129.     </xsl:template>
  130.         
  131.  
  132.      
  133.      <xsl:template name="document-group">
  134.          <xsl:param name="group"/>
  135.          
  136.          <!-- @ pre group code here -->
  137.          
  138.          <!-- - - -->
  139.  
  140.              <xsl:variable name="count" select="(position() - 1) * $group + 1"/>
  141.              
  142.              <xsl:for-each select="/session/content/document[$count <= position() and position() < ($count + $group)]">
  143.              
  144.                     <xsl:apply-templates select="."/>
  145.                    
  146.              </xsl:for-each>
  147.          
  148.          <!-- @ post group code here -->
  149.          
  150.          <!-- - - -->
  151.          
  152.      </xsl:template>
  153.  
  154.           
  155.      <xsl:template name="title">
  156.         <!--
  157.           @ Pre title html code here
  158.         -->
  159.         
  160.         <xsl:value-of select="/session/general-info/@title"/>
  161.         
  162.         <!--
  163.           @ Post title html code here
  164.         -->
  165.      </xsl:template>
  166.      
  167.      <!-- =============================
  168.              Document properties
  169.              
  170.      This section contains templates which
  171.      give the document properties...
  172.                    
  173.      ================================== -->
  174.      
  175.      <!-- this tempaltes gives the
  176.      relative href of the document. To use
  177.      with the <a href="..."> attribute-->
  178.     
  179.     
  180.      <xsl:template match="document" mode="href">
  181.        <xsl:value-of select="concat(../@directory,'/')"/>
  182.        <xsl:if test="@dir">
  183.          <xsl:value-of select="concat(@dir,'/')"/>
  184.        </xsl:if>
  185.        <xsl:value-of select="@fn"/>
  186.      </xsl:template>
  187.      
  188.      
  189.      <xsl:template match="document/@title">
  190.          <span class="doctitle">
  191.              <a>
  192.              <xsl:attribute name="href"> 
  193.                 <xsl:apply-templates select=".." mode="href"/>
  194.             </xsl:attribute> 
  195.             
  196.             <xsl:value-of select="."/>
  197.             </a>
  198.          </span>
  199.          <br/>
  200.      </xsl:template>
  201.      
  202.  
  203.      <xsl:template match="document/@description">
  204.          <span class="docdescription">
  205.              <xsl:value-of select="."/>
  206.          </span>
  207.          <br/>
  208.      </xsl:template>
  209.      
  210.  
  211.      <xsl:template match="document/@author">
  212.          <span class="docauthor">
  213.              <xsl:value-of select="."/>
  214.          </span>
  215.          <br/>
  216.      </xsl:template>
  217.      
  218.  
  219.      <xsl:template match="document/@create-date">
  220.          <span class="doccreationdate">
  221.              <xsl:value-of select="."/>
  222.          </span>
  223.          <br/>
  224.      </xsl:template>
  225.      
  226.  
  227.      <xsl:template match="document/@update-date">
  228.          <span class="doclastchangedate">
  229.              <xsl:value-of select="."/>
  230.          </span>
  231.          <br/>
  232.      </xsl:template>
  233.      
  234.  
  235.      <xsl:template match="document/@filename">
  236.          <span class="docfilename">
  237.              <xsl:value-of select="."/>
  238.          </span>
  239.          <br/>
  240.      </xsl:template>
  241.  
  242.  
  243.      <xsl:template match="document/@format">
  244.          <span class="docfileformatinfo">
  245.              <xsl:value-of select="."/>
  246.          </span>
  247.          <br/>
  248.      </xsl:template>
  249.  
  250.  
  251.      <xsl:template match="document/@pages">
  252.          <span class="docnumberofpages">
  253.              <xsl:value-of select="."/>
  254.          </span>
  255.          <br/>
  256.      </xsl:template>
  257.      
  258.  
  259.      <xsl:template match="document/@size">
  260.          <span class="docsizeinkb">
  261.              <xsl:value-of select="."/>
  262.          </span>
  263.          <br/>
  264.      </xsl:template>
  265.      
  266.      <xsl:template match="document/@icon">
  267.        <img src="images/{.}"/>
  268.          <br/>
  269.      </xsl:template>
  270.     
  271.  
  272.      <!-- =============================
  273.                    HTML HEAD
  274.                    
  275.     this section should not be changed
  276.      ================================== -->
  277.      
  278.      <xsl:template name="head">
  279.          <head>
  280.                 <title>
  281.                      <xsl:value-of select="/session/general-info/@title"/>
  282.                 </title>
  283.                 <!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> -->
  284.                 <meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8"/>
  285.                 <meta name="description" content="{/session/general-info/@description}"/>
  286.                 <meta name="keywords" content="{/session/general-info/@keywords}"/>
  287.                 <meta name="author" content="{/session/general-info/@author}"/>
  288.                 <meta name="email" content="{/session/general-info/@email}"/>
  289.                 <meta name="copyright" content="{/session/general-info/@copyright}"/>
  290.                 <!-- create date?
  291.                      update date?
  292.                      fav icon?
  293.                      -->
  294.              <link href="style.css" rel="stylesheet" type="text/css"/>
  295.  
  296.         </head>
  297.      </xsl:template>
  298.          
  299. </xsl:stylesheet>
  300.